package com.mioto.ld.communication.websocket.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author mioto-qinxj
 * @date 2024/5/16
 * @desc
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WsSendMessage {
    /**
     * 消息类型
     */
    private int cmd;
    /**
     * 消息体
     */
    private Object body;

    public WsSendMessage(SendCmdEnum sendCmdEnum) {
        this.cmd = sendCmdEnum.cmd();
        this.body = sendCmdEnum.desc();
    }
}
